class Person {
    // 使用public修饰符声明成员属性
    public name: string
    public age: number
    constructor(name: string, age: number) {
        this.name = name
        this.age = age
    }
}

const p: Person = new Person('陶品奇', 22)
console.log(p);



// 类的继承
class Student extends Person {
    public sex: string
    constructor(name: string, age: number, sex: string) {
        super(name, age)
        this.sex=sex
    }
}

const s: Student = new Student('马云', 52, '男')
console.log(s);
